package com.sca.commontest.test.designpattern.decorator.drink;

/**
 * @Author: denglei
 * @Date: 2022/1/7 10:15
 * @Description:
 */
public class DrinkCondiment extends Drink {

    private Drink drink;

    public DrinkCondiment(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float getCost() {
        return super.getPrice()+drink.getCost();
    }

    @Override
    public String getDesc(){
        return super.desc+"-"+drink.getDesc();

    }




}
